package com.eyaomall.wxmall.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eyaomall.wxmall.dao.ArticleDao;
import com.eyaomall.wxmall.model.po.Article;
import com.eyaomall.wxmall.service.ArticleService;
import com.lycheeframework.core.cmp.kit.PageHTTPObject;

@Service
public class ArticleServiceImpl implements ArticleService {
	
	@Autowired
	private ArticleDao articleDao;
	
	 
	/**
	 * 分页查询数据
	 */
	public Object pageDate(Article article, PageHTTPObject object) {
		return articleDao.page(article, object);
	}


	/**
	 * 更新阅读数
	 */
	public int updateNum(Integer id) {
		Article article = new Article();
		article.setId(id);
		Article art = (Article) articleDao.query(article);
		int flag = art.getClickNum();
		flag++;
		article.setClickNum(flag);
		return (int) articleDao.update(article);
	}


}
